package com.ruoyi.biz.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.biz.mapper.BizWeekRecommendMapper;
import com.ruoyi.biz.domain.BizWeekRecommend;
import com.ruoyi.biz.service.IBizWeekRecommendService;
import com.ruoyi.common.core.text.Convert;

/**
 * 本周推荐Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-01-15
 */
@Service
public class BizWeekRecommendServiceImpl implements IBizWeekRecommendService 
{
    @Autowired
    private BizWeekRecommendMapper bizWeekRecommendMapper;

    /**
     * 查询本周推荐
     * 
     * @param id 本周推荐ID
     * @return 本周推荐
     */
    @Override
    public BizWeekRecommend selectBizWeekRecommendById(Long id)
    {
        return bizWeekRecommendMapper.selectBizWeekRecommendById(id);
    }

    /**
     * 查询本周推荐列表
     * 
     * @param bizWeekRecommend 本周推荐
     * @return 本周推荐
     */
    @Override
    public List<BizWeekRecommend> selectBizWeekRecommendList(BizWeekRecommend bizWeekRecommend)
    {
        return bizWeekRecommendMapper.selectBizWeekRecommendList(bizWeekRecommend);
    }

    /**
     * 新增本周推荐
     * 
     * @param bizWeekRecommend 本周推荐
     * @return 结果
     */
    @Override
    public int insertBizWeekRecommend(BizWeekRecommend bizWeekRecommend)
    {
        bizWeekRecommend.setCreateTime(DateUtils.getNowDate());
        return bizWeekRecommendMapper.insertBizWeekRecommend(bizWeekRecommend);
    }

    /**
     * 修改本周推荐
     * 
     * @param bizWeekRecommend 本周推荐
     * @return 结果
     */
    @Override
    public int updateBizWeekRecommend(BizWeekRecommend bizWeekRecommend)
    {
        bizWeekRecommend.setUpdateTime(DateUtils.getNowDate());
        return bizWeekRecommendMapper.updateBizWeekRecommend(bizWeekRecommend);
    }

    /**
     * 删除本周推荐对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteBizWeekRecommendByIds(String ids)
    {
        return bizWeekRecommendMapper.deleteBizWeekRecommendByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除本周推荐信息
     * 
     * @param id 本周推荐ID
     * @return 结果
     */
    @Override
    public int deleteBizWeekRecommendById(Long id)
    {
        return bizWeekRecommendMapper.deleteBizWeekRecommendById(id);
    }
}
